package
{
	import mx.collections.ArrayCollection;
	
	public class MemoInfo
	{
		public var ob:ArrayCollection = new ArrayCollection();
		public var name:ArrayCollection = new ArrayCollection();
		public var xp:ArrayCollection = new ArrayCollection();
		public var yp:ArrayCollection = new ArrayCollection();
		public var str:ArrayCollection = new ArrayCollection();
		private var i:int;
		private var index:int;
		
		public function MemoInfo()
		{
		}
		
		public function addPoint(ob:Object, name:String, xp:int, yp:int, str:String):void{
		
			this.ob.addItem(ob);
			this.name.addItem(name);		
			this.xp.addItem(xp);
			this.yp.addItem(yp);
			this.str.addItem(str);
		
		}
		
		public function getSize():int{
			return xp.length;
		} 
		
		public function reset():void{
			ob.removeAll();
			name.removeAll();
			xp.removeAll();
			yp.removeAll();
			str.removeAll();
		}
		
		public function modify(name:String, xp:int, yp:int, str:String):void{
			
			for(i=0; i<this.xp.length; i++){
				if(name.localeCompare((String)(this.name.getItemAt(i)))==0){
					this.index = i;
				}
			}
			
			this.xp.setItemAt(xp, index);
			this.yp.setItemAt(yp, index);
			this.str.setItemAt(str, index);
		
		}
		
		public function del(memo:Object):void{
			for(i=0; i<this.xp.length; i++){
				if(memo == this.ob.getItemAt(i)){
					ob.removeItemAt(i);
					name.removeItemAt(i);
					xp.removeItemAt(i);
					yp.removeItemAt(i);
					str.removeItemAt(i);
				}
			}
		}

	}
}